import request from '@/utils/request'

export const GoodsClassApi = {

    /**
     *  获取所有角色
     * @returns
     */
    getAllList: () => {
        return request({
            url: '/manage/food/goodsClass/getAllList',
            method: 'get'
        })
    },

    /**
     *  删除
     * @returns
     */
    delete: (goodsClassId) => {
        return request({
            url: '/manage/food/goodsClass/delete',
            params: {goodsClassId},
            method: 'get'
        })
    },

    /**
     *  更新
     * @returns
     */
    update: (data) => {
        return request({
            url: '/manage/food/goodsClass/update',
            data,
            method: 'post'
        })
    },

    /**
     *  插入
     * @returns
     */
    insert: (data) => {
        return request({
            url: '/manage/food/goodsClass/insert',
            data,
            method: 'post'
        })
    },

    /**
     *  修改排序
     * @returns
     */
    updateSort: (data) => {
        return request({
            url: '/manage/food/goodsClass/updateSort',
            data,
            method: 'post'
        })
    },

    /**
     *  修改状态
     * @returns
     */
    updateStatus: (data) => {
        return request({
            url: '/manage/food/goodsClass/updateStatus',
            data,
            method: 'post'
        })
    },

    /**
     *  查询子类
     * @returns
     */
    getListByParentId: (parentId) => {
        return request({
            url: '/manage/food/goodsClass/getListByParentId',
            params: {parentId},
            method: 'get'
        })
    },
}
